home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / amyboard / xboard-3.3.pl0 / configure.in < prev    next >
Text File  |  1995-08-12  |  7KB  |  257 lines

  1. dnl: You can process this file with autoconf to produce a configure script.
  2. dnl: However, normally the supplied configure script will work fine.
  3.  
  4. AC_INIT(xboard.c)
  5. AC_CONFIG_HEADER(config.h)
  6.  
  7. PRODUCT=xboard
  8. VERSION=3.3
  9. PATCHLEVEL=0
  10.  
  11. if test -z "$CFLAGS" ; then
  12. dnl: Prevent the next macro from setting CFLAGS to -g
  13.   CFLAGS=" "
  14. fi
  15. AC_PROG_CC
  16. AC_ISC_POSIX
  17. AC_PROG_INSTALL
  18. AC_CHECK_PROGS(LEX, lex flex, lex)
  19. AC_DECL_YYTEXT
  20. AC_CHECK_PROGS(RSH, remsh rsh, rsh)
  21. AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$RSH")
  22. AC_CHECK_PROG(NROFF, nroff, [nroff -man], cat)
  23. AC_SUBST(NROFFFLAGS)
  24. AC_PATH_PROGS(AWKPATH, awk mawk gawk nawk)
  25. AC_PATH_PROGS(PERLPATH, perl)
  26.  
  27. AC_HEADER_STDC
  28. AC_HEADER_TIME
  29. AC_HEADER_SYS_WAIT
  30. AC_TYPE_SIGNAL
  31. AC_CHECK_HEADERS(stropts.h sys/time.h string.h unistd.h sys/systeminfo.h)
  32. AC_CHECK_HEADER(fcntl.h,
  33.   AC_DEFINE(HAVE_FCNTL_H), AC_CHECK_HEADERS(sys/fcntl.h))
  34. AC_CHECK_HEADER(sys/socket.h,
  35.   AC_DEFINE(HAVE_SYS_SOCKET_H), AC_CHECK_HEADERS(lan/socket.h))
  36. AC_CHECK_HEADER(stddef.h, [], AC_DEFINE(X_WCHAR, 1))
  37.  
  38. AC_CHECK_FUNCS(_getpty grantpt)
  39. AC_CHECK_FUNC(gettimeofday,
  40.   AC_DEFINE(HAVE_GETTIMEOFDAY), AC_CHECK_FUNCS(ftime))
  41. AC_CHECK_FUNC(random,
  42.   AC_DEFINE(HAVE_RANDOM), AC_CHECK_FUNCS(rand48))
  43. AC_CHECK_FUNC(gethostname,
  44.   AC_DEFINE(HAVE_GETHOSTNAME), AC_CHECK_FUNCS(sysinfo))
  45. AC_CHECK_FUNC(setlocale, [],
  46.   AC_CHECK_LIB(i, setlocale, [], AC_DEFINE(X_LOCALE, 1)))
  47.  
  48. AC_CHECK_LIB(seq, getpseudotty)
  49.  
  50. AC_PATH_XTRA
  51.  
  52. AC_CANONICAL_HOST
  53.  
  54. dnl: The following info is mostly gathered from GNU Emacs 19.24.  Basically,
  55. dnl: we are trying to find out whether this is a System-V derivative (in
  56. dnl: which case we must use ptys) and if so, whether there is anything
  57. dnl: strange about the way to open a pty.  Some of the work was done above
  58. dnl: by looking for _getpty, grantpt, and getpseudotty.  A few other strange
  59. dnl: properties of particular systems are also handled here.
  60.  
  61. USE_PTYS=0
  62. case "$host" in
  63.   *-*-hpux* )
  64.     AC_DEFINE(PTY_TTY_NAME_SPRINTF,
  65.     [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);])
  66.     AC_DEFINE(PTY_NAME_SPRINTF,
  67.     [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);])
  68.     USE_PTYS=1
  69.     if test "$GCC" = yes; then
  70.       CONF_CFLAGS="-fwritable-strings"
  71.     else
  72.  
  73. dnl: Note: You might be able to build xboard even if your compiler does not
  74. dnl: support ANSI C (-Aa).  xboard itself does not require ANSI C.  I don't
  75. dnl: know whether the X header files on HP-UX require it.
  76.  
  77.       CONF_CFLAGS="-Aa -D_HPUX_SOURCE"
  78.     fi
  79.  
  80. dnl: HP doesn't supply a full set of X header files and libraries.  People
  81. dnl: often have some things installed in one place and some in another. 
  82. dnl: AC_PATH_XTRA will find only one place, so we try to add all the
  83. dnl: likely ones that might be missing here.  It might be better to
  84. dnl: change AC_PATH_XTRA to try to extract this information from imake,
  85. dnl: since folks who install the missing bits often configure their
  86. dnl: imake to find them, but I don't want to delve into autoconf deeply
  87. dnl: enough to make it do that right.
  88.  
  89.     if test -d /usr/include/X11R5; then
  90.       X_CFLAGS="-I/usr/include/X11R5 $X_CFLAGS"
  91.       X_LIBS="-L/usr/lib/X11R5 -L/usr/lib/X11R4 $X_LIBS"
  92.     elif test -d /usr/include/X11R4; then
  93.       X_CFLAGS="-I/usr/include/X11R4 $X_CFLAGS"
  94.       X_LIBS="-L/usr/lib/X11R4 $X_LIBS"
  95.     fi
  96.     if test -d /MIT/X11R5/include; then
  97.       X_CFLAGS="-I/MIT/X11R5/include $X_CFLAGS"
  98.       X_LIBS="-L/MIT/X11R5/lib $X_LIBS"
  99.     elif test -d /usr/local/include/X11R5; then
  100.       X_CFLAGS="-I/usr/local/include/X11R5 $X_CFLAGS"
  101.       X_LIBS="-L/usr/local/lib/X11R5 $X_LIBS"
  102.     fi
  103.   ;;
  104.  
  105.   romp-ibm-aix* )
  106.     AC_DEFINE(IBMRTAIX, 1)
  107.     USE_PTYS=1
  108.   ;;
  109.  
  110.   i386-ibm-aix )
  111.     USE_PTYS=1
  112.     if test "$GCC" = yes; then
  113.       CONF_CFLAGS="-fwritable-strings"
  114.     fi
  115.   ;;
  116.  
  117.   *-*-aix3* | *-*-bosx* )
  118.     AC_DEFINE(PTY_ITERATION, [])
  119.     AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");])
  120.     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));])
  121.     USE_PTYS=1
  122.   ;;
  123.  
  124.   *-*-cxux* )
  125.     AC_DEFINE(FIRST_PTY_LETTER, 'A')
  126.     AC_DEFINE(LAST_PTY_LETTER, 'P')
  127.     USE_PTYS=1
  128.   ;;
  129.  
  130.   *-*-uniplus* )
  131.     AC_DEFINE(UNIPLUS, 1)
  132.     USE_PTYS=1
  133.   ;;
  134.  
  135.   *-*-rtu* )
  136.     AC_DEFINE(FIRST_PTY_LETTER, 'z')
  137.     AC_DEFINE(PTY_TTY_NAME_SPRINTF,
  138.         [sprintf (pty_name, "/dev/ttyp%x", i);])
  139.     AC_DEFINE(PTY_NAME_SPRINTF,
  140.     [sprintf (pty_name, "/dev/pty%x", i);])
  141.     AC_DEFINE(RTU, 1)
  142.   ;;
  143.  
  144.   *-*-iris* | *-*-irix3* )
  145.     AC_DEFINE(PTY_ITERATION, [])
  146.     AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");])
  147.     AC_DEFINE(PTY_TTY_NAME_SPRINTF,
  148.     [sprintf (pty_name, "/dev/ttyq%d", minor(stb.st_rdev));])
  149.     USE_PTYS=1
  150.   ;;
  151.  
  152.   *-*-irix* )
  153.     USE_PTYS=1
  154.   ;;
  155.  
  156.   *-*-sunos4* | *-*-solaris1* )
  157.  
  158. dnl: Work around a bug in the SunOS 4.x linker.  Not needed if you have 
  159. dnl:  patches 100512-02 and 100573-03 from Sun.
  160.  
  161.     if test "$GCC" = yes; then
  162.       PRE_XMULIB="-static"
  163.       POST_XMULIB="-dynamic"
  164.     else
  165.       PRE_XMULIB="-Bstatic"
  166.       POST_XMULIB="-Bdynamic"
  167.     fi
  168.   ;;
  169.  
  170.   *-*-sunos5* | *-*-solaris2* )
  171.     USE_PTYS=1
  172.  
  173. dnl: I'm not sure -lelf is needed, but it was in the old Imakefile.
  174. dnl: The other libraries should all be found by Ac_PATH_XTRA or other
  175. dnl: code above.
  176.  
  177.     X_LIBS="$X_LIBS -lelf"
  178.   ;;
  179.  
  180.   *-*-sco* )
  181.     AC_DEFINE(PTY_ITERATION, [for (i = 0; ; i++)])
  182.     AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptyp%d", i);])
  183.     AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ttyp%d", i);])
  184.     USE_PTYS=1
  185.   ;;
  186.     
  187.   *-*-dynix* | *-*-ptx* )
  188.     USE_PTYS=1
  189.   ;;
  190.  
  191.   *-*-esix* )
  192.     USE_PTYS=1
  193.   ;;
  194.  
  195.   *-*-usg5-4* | *-*-sysvr4* )
  196.     USE_PTYS=1
  197.   ;;
  198.  
  199.   *-*-usg* | *-*-sysv* | *-*-aix* )
  200.     USE_PTYS=1
  201.   ;;
  202.  
  203.   vax-*-ultrix )
  204.     if test "$GCC" = yes; then
  205.       CONF_CFLAGS="-fwritable-strings"
  206.     fi
  207.   ;;
  208. esac
  209.  
  210. AC_SUBST(PRE_XMULIB)
  211. AC_SUBST(POST_XMULIB)
  212. AC_SUBST(CONF_CFLAGS)
  213. AC_SUBST(CONF_LDFLAGS)
  214.  
  215. AC_MSG_CHECKING(whether ptys or pipes should be used)
  216. AC_ARG_ENABLE(ptys, 
  217. [  --enable-ptys   Force use of pseudo-ttys to communicate with child processes
  218.   --disable-ptys  Force use of pipes to communicate with child processes],
  219. [if test "$enableval" = yes; then
  220.   USE_PTYS=1
  221.   AC_MSG_RESULT([ptys (user override)])
  222. fi
  223. if test "$enableval" = no; then
  224.   USE_PTYS=0
  225.   AC_MSG_RESULT([pipes (user override)])
  226. fi],
  227. [if test "$USE_PTYS" = 1; then
  228.   AC_MSG_RESULT(ptys)
  229. else
  230.   AC_MSG_RESULT(pipes)
  231. fi])
  232. AC_DEFINE_UNQUOTED(USE_PTYS, $USE_PTYS)
  233.  
  234. AC_ARG_ENABLE(zippy, [],
  235. [if test "$enableval" = yes; then
  236. dnl: Extra software not included in the standard xboard distribution
  237.   PATCHLEVEL="$PATCHLEVEL"-zippy
  238.   AC_DEFINE(ZIPPY, 1)
  239.   ZIPPY_O=zippy.o
  240.   ZIPPY_H=zippy.h
  241. fi])
  242. AC_SUBST(ZIPPY_O)  
  243. AC_SUBST(ZIPPY_H)  
  244.  
  245. AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT")
  246. AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
  247. AC_DEFINE_UNQUOTED(PATCHLEVEL, "$PATCHLEVEL")
  248. AC_SUBST(PRODUCT)
  249. AC_SUBST(VERSION)
  250. AC_SUBST(PATCHLEVEL)
  251.  
  252. AC_OUTPUT(Makefile comment.awk:comment.in cmail xboard.texinfo,
  253. [test -z "$CONFIG_HEADERS" || date > stamp-h
  254. chmod 755 comment.awk cmail
  255. rm -f *.o
  256. ])
  257.